using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using BangleAbp.Permissions;
using BangleAbp.Products.Dtos;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;

namespace BangleAbp.Products
{
    public class ProductTypeAppService : CrudAppService<ProductType, ProductTypeDto, Guid, PagedAndSortedResultRequestDto, CreateUpdateProductTypeDto, CreateUpdateProductTypeDto>,
        IProductTypeAppService
    {
        private readonly IProductTypeRepository _repository;

        public ProductTypeAppService(IProductTypeRepository repository) : base(repository)
        {
            _repository = repository;
        }

        [Authorize(BangleAbpPermissions.ProductTypeCreate)]
        public override Task<ProductTypeDto> CreateAsync(CreateUpdateProductTypeDto input)
        {
            return base.CreateAsync(input);
        }

        [Authorize(BangleAbpPermissions.ProductTypeDelete)]
        public override Task DeleteAsync(Guid id)
        {
            return base.DeleteAsync(id);
        }

        [Authorize(BangleAbpPermissions.ProductType)]
        public override Task<ProductTypeDto> GetAsync(Guid id)
        {
            return base.GetAsync(id);
        }

        [Authorize(BangleAbpPermissions.ProductType)]
        public override Task<PagedResultDto<ProductTypeDto>> GetListAsync(PagedAndSortedResultRequestDto input)
        {
            return base.GetListAsync(input);
        }

        [Authorize(BangleAbpPermissions.ProductTypeUpdate)]
        public override Task<ProductTypeDto> UpdateAsync(Guid id, CreateUpdateProductTypeDto input)
        {
            return base.UpdateAsync(id, input);
        }
    }
}